// XMLConfigFile.h
// 
// Copyright (c) Jason Sandys, 2009
//
// License: This code is released according to the 
// Microsoft Public License (Ms-PL) as documented at 
// http://osdappchooser.codeplex.com/license
//
//////////////////////////////////////////////////////////////////////

#pragma once

#include "Resource.h"

//************************************************************
/**
<summary>A Generic class to load and retrieve information from
an XML configuration file</summary>
*/
//************************************************************
class CjXMLConfigFile
{
public:
	CjXMLConfigFile(LPCTSTR szFilepath = 0);
	~CjXMLConfigFile(void);

protected:
	///<summary>The DOM corresponding to the XML configuration file</summary>
	XmlDocument m_docConfig;

	///<summary>The path name of the configuration file</summary>
	CString m_strFilePath;
	///<summary>The name of the root element</summary>
	CString m_strRootNodeName;

	void LoadNode (XmlElement& eLoad, CString strElementName, DWORD dwNodeLoadError);

public:
	void LoadFile(LPCTSTR szFilepath);
};
